import os
import time


# print(os.path.realpath(__file__))
# print(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
# print(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file", "black.jpg"))

# 获取图片路径
def get_black_path():
    path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file", "black.jpg"))
    return path


# 下载文件存储路径
def download_fild_path():
    path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file"))
    return path


# 获取data_yaml文件路径
def get_yaml_path():
    path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "data", "data.yaml"))
    return path


# 截图保存路径
def get_screen_shot_path():
    # 截图的文件名
    file_name = "截图{}.png".format(time.strftime("%Y-%m-%d_%H_%M_%S"))
    path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file", file_name))
    return path


# 日志路径
def get_log_path():
    log_path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "log"))
    return log_path


# 获取数据库配置
def get_ini_path():
    ini_path = (os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "config", "settings.ini"))
    return ini_path


if __name__ == '__main__':
    print(download_fild_path())
    print(get_screen_shot_path())
    print(get_black_path())
